package git.bankview.wl.auth;

import laya.semi.process.*;

import git.bankview.sl.auth.*;
import git.bankview.wl.bean.*;

import org.apache.log4j.Logger;

public class UserTransLoader
	implements IGenericClassActivity
{
	private static Logger log = Logger.getLogger(UserTransLoader.class);
   
	public void execute(IProcessContext oCtx)
		throws Exception
	{
		// result:parents:user-bean-name
		String[] vArg = oCtx.getActivityParameter().split(":");
		
		String[] vParent = (String[])oCtx.getField(vArg[1]);
		LogonBean oUser = (LogonBean)oCtx.getField(vArg[2]);
		
		String oParent = null;
		if (null != vParent && 0 < vParent.length)
			oParent = vParent[0];
		
		oCtx.setField(vArg[0], AuthHelper.getSubtransByParent(oParent, oUser.getUsername()));
	}
}
